package day7;

/**
 * @author oldliu
 * @since 1.0
 */
public class Zhishu1000 {
    //平方和质数
    public static void main(String[] args) {
        for (int i = 1; i <= 1e8; i++) {
            if(i==1)
                continue;
            //判断e是不是质数
            int e = (int) Math.sqrt(i);
            boolean iszhi=true;
            for (int j=2;j<=e;j++){
                if(i%j==0){
                    iszhi=false;
                    break;
                }
            }
            if(iszhi==false)
                continue;
            for (int j = 1; j <= e; j++) {
                int f=i-j*j;
                if(f<0) break;
                int h= (int) Math.sqrt(f);
                if(h*h==f){
                    System.out.println(h+"^2X"+j+"^2="+i);
                    break;
                }
            }
        }
    }
}
